Bump rails_semantic_logger from 4.20.0 to 5.0.0#921
Conversation
Test coverage92.17% line coverage reported by SimpleCov. |
Bumps [rails_semantic_logger](https://github.com/reidmorrison/rails_semantic_logger) from 4.20.0 to 5.0.0. - [Changelog](https://github.com/reidmorrison/rails_semantic_logger/blob/main/CHANGELOG.md) - [Commits](reidmorrison/rails_semantic_logger@v4.20.0...v5.0.0) --- updated-dependencies: - dependency-name: rails_semantic_logger dependency-version: 5.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
4cbc1a2 to
60bc156
Compare
|
Just looking though this and making the recommended changes |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 5 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
config/application.rb:81
- Logging configuration change drops the previous global
config.semantic_logger.applicationsetting and switches non-RAILS_LOG_TO_STDOUToutput to:color, which can break JSON log ingestion/aggregation in production. Also, the prior$stdout.sync = truesafeguard for stdout logging was removed, which can lead to buffered / delayed logs on platforms like Heroku.
config.rails_semantic_logger.appenders do |appenders|
if ENV['RAILS_LOG_TO_STDOUT'].present?
# Log to STDOUT on Heroku in JSON format, where this variable is set automatically.
appenders.add(io: $stdout, formatter: :json, application: "editor-api@#{ENV['HEROKU_SLUG_COMMIT'] || 'unknown'}")
else
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 5 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
config/application.rb:81
- In the RailsSemanticLogger v5 appenders DSL,
addis for the init context, whileadd_serverapplies when serving requests. In theRAILS_LOG_TO_STDOUTbranch this usesappenders.add(...), which risks not attaching the STDOUT JSON appender for actual request logging. Also, the prior$stdout.sync = trueandconfig.semantic_logger.application = ...are no longer set, so logs may be buffered and the application name may not be applied as expected.
config.rails_semantic_logger.appenders do |appenders|
if ENV['RAILS_LOG_TO_STDOUT'].present?
# Log to STDOUT on Heroku in JSON format, where this variable is set automatically.
appenders.add(io: $stdout, formatter: :json, application: "editor-api@#{ENV['HEROKU_SLUG_COMMIT'] || 'unknown'}")
else
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 01ca3a0. Configure here.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 5 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
config/application.rb:87
- In the non-RAILS_LOG_TO_STDOUT branch, the appender configuration sets
application: 'editor-ui'(likely a typo for this service) and adds a base$stdoutappender in addition toadd_server/add_console, which can result in duplicated output while serving requests and noisy test/CI logs. Also, when logging to STDOUT (Heroku branch)$stdout.sync = truewas previously set and is important to avoid buffered/late log delivery.
config.rails_semantic_logger.appenders do |appenders|
if ENV['RAILS_LOG_TO_STDOUT'].present?
# Log to STDOUT on Heroku in JSON format, where this variable is set automatically.
appenders.add(io: $stdout, formatter: :json, application: "editor-api@#{ENV['HEROKU_SLUG_COMMIT'] || 'unknown'}")
else
appenders.add(file_name: "log/#{Rails.env}.log", formatter: :default, application: 'editor-ui')
appenders.add(io: $stdout, formatter: :default, application: 'editor-ui')
appenders.add_server(formatter: :color, application: 'editor-api') # $stdout while serving
appenders.add_console(formatter: :color, application: 'editor-api') # $stderr inside `rails console`
end
end
01ca3a0 to
66e63f2
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 5 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
config/application.rb:86
- In the non-STDOUT branch, both
appenders.add(io: $stdout, ...)andappenders.add_server(...)target stdout. Sinceaddis always active andadd_serveradds an additional destination while serving requests, this will duplicate log output to stdout. This also changes the default formatting away from the previously configured JSON and repeats the application name in multiple places; consider keeping JSON formatting and a single destination per context, and setconfig.semantic_logger.applicationonce globally.
appenders.add(file_name: "log/#{Rails.env}.log", formatter: :default, application: 'editor-api')
appenders.add(io: $stdout, formatter: :default, application: 'editor-api')
appenders.add_server(formatter: :color, application: 'editor-api') # $stdout while serving
appenders.add_console(formatter: :color, application: 'editor-api') # $stderr inside `rails console`
end
66e63f2 to
9176f02
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 5 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
config/application.rb:81
- When logging to STDOUT, the previous production config also set
$stdout.sync = trueand setconfig.semantic_logger.applicationglobally. The new config dropssync(risking buffered logs in non-TTY environments) and instead passesapplication:intoappenders.add, which may not apply consistently across all appenders/log entries. Consider restoringsyncand setting the application name viaconfig.semantic_logger.application, keeping the appender config focused on destination/formatter.
if ENV['RAILS_LOG_TO_STDOUT'].present?
config.rails_semantic_logger.appenders do |appenders|
# Log to STDOUT on Heroku in JSON format, where this variable is set automatically.
appenders.add(io: $stdout, formatter: :json, application: "editor-api@#{ENV['HEROKU_SLUG_COMMIT'] || 'unknown'}")
end

Bumps rails_semantic_logger from 4.20.0 to 5.0.0.
Changelog
Sourced from rails_semantic_logger's changelog.
... (truncated)
Commits
001d671README: move container platform recipe to docsf11ebd6Rewrite README to match docs and the appenders configurationbf4c700Trim README: move upgrade notes to docs, condense examples2ca6cf6Prepare v5.0.0 release: use rubygems semantic_logger 5.06756a86Merge pull request #314 from reidmorrison/fix/activesupport-logger-hijack-141aabc6ecStop hijacking ActiveSupport::Logger.new when a destination is given1b5a698Merge pull request #313 from reidmorrison/feature/subscriber-metricsc237585Pass class/module constants to SemanticLogger[] instead of strings2ebe76aActionView: log under ActionView::Base namec956f1bEmit prototype metrics for info/warn/error log subscriber entries